<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false"%>
<html>
<head>
    <title>主拖件管理</title>
    <style>
        .table-responsive{
            overflow: auto; width: 100%;
        }
        .table {
            white-space: nowrap;
            overflow:scroll;
            width: inherit;
        }
        .table td {
            white-space: nowrap;
            text-overflow: ellipsis;
        }
    </style>
</head>
<body>
    <div ng-app="myApp" ng-controller="MajorCtrl">
        <div class="row">
            <ui-container url="rule/major/list" key="major-list-00">
                <ui-search-form>
                    <search-select class="col-md-2" name="state">
                        <option value="">请选择激活状态</option>
                        <option value="0">非激活 </option>
                        <option value="1">激活</option>
                    </search-select>
                </ui-search-form>
                    <ui-table-tool>
                        <a  class="btn btn-sm btn-primary" href="rule/major/add" >新增</a>
                    </ui-table-tool>
                <ui-table>
                    <ui-form-input name="description" label="规则描述:"></ui-form-input>
                    <ui-form-input name="parser" label="规则解析器类:"></ui-form-input>
                    <ui-form-input name="initJson" label="解析器类初始化参数:" ></ui-form-input>
                    <ui-form-input name="supplierName" label="供应商名称:" ></ui-form-input>
                    </ui-form>
                </ui-table>
                <table-page/>
            </ui-container>
        </div>
        <%--<div class="row" id="majorRuleImport">--%>
            <%--<a  class="btn btn-sm btn-primary" href="javascript:void(0);" ng-click="exportDatas()" target="_blank" >下载模板</a>--%>
            <%--<ui-upload url="rule/major/import" success="uploadSuccess"></ui-upload>--%>
        <%--</div>--%>
    </div>
<script>
    angular.module('myApp',['ui.table']);
    angular.module('myApp').controller('MajorCtrl', function($scope){
//        $scope.uploadSuccess=function (returndata) {
//            $("#supplierImport").find(".upload-result").remove();
//            if(returndata.data["fileKey"]){
//                $("#supplierImport").append('<a  class="btn btn-sm btn-success upload-result" href="system/supplier/down?fileKey='+returndata.data["fileKey"]+'" target="_blank" >下载导入失败的记录</a>');
//            }
//            toastr.success("总共"+returndata.data["totalNums"]+"条,成功"+returndata.data["successNums"]+"条");
//        }
//
//        $scope.exportDatas = function(){
//            var params = {
//                url: 'system/supplier/exporttemplate',
//                type: "POST"
//            };
//            var exportForm = $("<form>");
//            $(exportForm).css("display", "none");
//            $(exportForm).attr('target', 'targetFrame');
//            $(exportForm).attr('method', params.type);
//            $(exportForm).attr('action', params.url);
//            exportForm = exportForm.appendTo($("body"));
//            exportForm.submit();
//            exportForm.remove();
//        }


        $scope.addOrg=function (items) {
            console.info(items)
        }
        //每一列的操作按钮
        $scope._operateColumns=[{text:'编辑',click:function (data) {
            window.open("rule/major/update?id="+data.id,"_target");
        }}]

        $scope._columns=[   {name:'id',head:'id'},
            {name:'supplierName',head:'供应商'},
            {name:'description',head:'规则描述'},
            {name:'parser',head:'规则解析器类'},
            {name:'state',head:'激活状态',render(data,value){return value=='0'?'否':'是'}},
            {name:'initJson',head:'解析器类初始化参数'}
        ];


    });
</script>
</body>
</html>
